import {
	HTTP
} from '../utils/http.js'
let http = new HTTP()

/* 
	@desc 获取商品类别
 */
export const getProductCategoryList = (data) => {
	return http.request({
		url: 'API/Product/GetProductCategoryList',
		method: 'POST',
		data
	})
}

/* 
	POST 用户船票订单列表
 */
export const getShipTicketList = (data) => {
	return http.request({
		url: 'API/Orders/GetShipTicketList',
		method: 'POST',
		data
	})
}

/* 
	POST 船票订单详情
 */
export const getShipTicketInfo = (data) => {
	return http.request({
		url: 'API/Orders/GetShipTicketInfo',
		method: 'POST',
		data
	})
}

/* 
	@desc 获取商品列表
 */
export const getGoodsList = (data) => {
	return http.request({
		url: '/API/Product/GetList',
		method: 'POST',
		data
	})
}

/* 
	@desc 获取商品详情
 */
export const getGoodsDetail = (data) => {
	return http.request({
		url: '/API/Product/GetDetail',
		method: 'POST',
		data
	})
}
/*
	@desc 获取活动人数
 */
export const getEleCouponOrderCount = (data) => {
	return http.request({
		url: '/API/Orders/GetEleCouponOrderCount',
		method: 'POST',
		data
	})
}
// 获取商家列表
export const getPointsExchangeRatio = () => {
	return http.request({
		url: '/API/System/GetPointsExchangeRatio',
		method: 'POST'
	})
}
// 获取商家列表
export const getBdcRoute = () => {
	return http.request({
		url: '/API/System/GetBdcRoute', 
		method: 'POST'
	})
}
// 获取商家列表
export const getSystemValueByKey = (KeyName) => {
	return http.request({
		url: '/API/System/GetSystemValueByKey',
		method: 'POST',
		data: {
			KeyName
		}
	})
}
// 获取商家列表
export const getShopTypeList = (data) => {
	return http.request({
		url: '/API/ProductCategoryType/List',
		method: 'POST',
		data
	})
}
// 获取商家列表
export const getProductTagGroup = (data) => {
	return http.request({
		url: '/API/ProductTagGroup/List',
		method: 'POST',
		data
	})
}
// 获取商家列表
export const getShopTypeDetailList = (data) => {
	return http.request({
		url: '/API/ProductCategoryType/Detail',
		method: 'POST',
		data
	})
}
// 获取商家列表
export const getShopBgList = (data) => {
	return http.request({
		url: '/API/Business/GetList',
		method: 'POST',
		data
	})
}
// 获取商家列表
export const getBusinessClassifyGroup = (data) => {
	return http.request({
		url: '/API/BusinessClassifyGroup/GetList',
		method: 'POST',
		data
	})
}

//获取店铺详情

export const getShopBgDetail = (data) => {
	return http.request({
		url: '/API/Business/GetDetial',
		method: 'POST',
		data
	})
}
//推荐商品
export const getShopGoodsDetail = (data) => {
	return http.request({
		url: '/API/Product/GetList',
		method: 'POST',
		data
	})
}

/* 
	@desc 添加产品收藏
 */
export const addProductCollection = (data) => {
	return http.request({
		url: '/API/Users/AddProductCollection',
		method: 'POST',
		data
	})
}

/* 
	@desc 取消产品收藏
 */
export const cancelProductCollection = (data) => {
	return http.request({
		url: '/API/Users/CancelCollection',
		method: 'POST',
		data
	})
}

/*
	@desc 检测产品是否收藏
 */
export const checkProductCollection = (data) => {
	return http.request({
		url: '/API/Users/CheckProductCollection',
		method: 'POST',
		data
	})
}

/*
	@desc 添加收货地址
	"Data": {
		"Id": 1,
		"Province": "sample string 2",
		"City": "sample string 3",
		"County": "sample string 4",
		"Address": "sample string 5",
		"Name": "sample string 6",
		"Mobile": "sample string 7",
		"PostalCode": "sample string 8",
		"NickName": "sample string 9",
		"IsDefault": 10,
		"SelfOrLogs": 11,
		"IDCard": "sample string 12"
	 }
	
	
 */
export const addAcceptAddress = (data) => {
	return http.request({
		url: '/API/Users/AddAcceptAddress',
		method: 'POST',
		data
	})
}


/* 
	@desc 获取收获地址列表
 */
export const getAcceptAddressList = (data) => {
	return http.request({
		url: '/API/Users/GetAcceptAddressList',
		method: 'POST',
		data
	})
}

/*
	@desc 删除收货地址
 */
export const deleteAcceptAddress = (data) => {
	return http.request({
		url: '/API/Users/DeleteAcceptAddress',
		method: 'POST',
		data
	})
}

/*
	@desc 修改收货地址
 */
export const updateAcceptAddress = (data) => {
	return http.request({
		url: '/API/Users/UpdateAcceptAddress',
		method: 'POST',
		data
	})
}

/* 
	@desc 新增联系人
 */
export const addUsersContacts = (data) => {
	return http.request({
		url: '/API/Users/AddUsersContacts',
		method: 'POST',
		data
	})
}

/* 
	@desc 获取联系人列表
 */
export const getUsersContactsList = (data) => {
	return http.request({
		url: '/API/Users/GetUsersContactList',
		method: 'POST',
		data
	})
}


/* 
	@desc 更新联系人
 */
export const updateUsersContacts = (data) => {
	return http.request({
		url: '/API/Users/UpdateUsersContact',
		method: 'POST',
		data
	})
}

/* 
	@desc 删除联系人
 */
export const deleteUsersContacts = (data) => {
	return http.request({
		url: '/API/Users/DeleteUsersContact',
		method: 'POST',
		data
	})
}

/*
	@desc 新增订单--票据，住宿，美食等
 */
export const addEleCouponOrders = (data) => {
	return http.request({
		url: '/API/Orders/AddEleCouponOrders',
		method: 'POST',
		data
	})
}

/*
	@desc 新增套餐列表
 */
export const addPackProductOrders = (data) => {
	return http.request({
		url: '/API/Orders/AddPackProductOrders',
		method: 'POST',
		data
	})
}

/*
	@desc 套餐提交接口
 */
export const AddOrders_V2 = (data) => {
	return http.request({
		url: '/API/Orders/AddOrders_V2',
		method: 'POST',
		data
	})
}

/*
	@desc 套餐产品预约提交
 */
export const postBookPackProductOrderInfo = (data) => {
	return http.request({
		url: '/API/Orders/BookPackProductOrderInfo',
		method: 'POST',
		data
	})
}

/*
	@desc 新增线上实物商品订单
 */
export const addProductOrders = (data) => {
	return http.request({
		url: '/API/Orders/AddProductOrders',
		method: 'POST',
		data
	})
}

/* 
	@desc 获取用户订单
 */
export const getUserOrderList = (data) => {
	return http.request({
		url: '/API/Orders/GetUserOrderList',
		method: 'POST',
		data
	})
}

/* 
	@desc 获取用户套餐预约订单
 */
export const getUserCardInfoList = (data) => {
	return http.request({
		url: '/API/Orders/GetUserCardInfoList',
		method: 'POST',
		data
	})
}

/* 
	@desc 取消订单
		"OrdersOnLineId": 1,
		"OrdersOnLineType": 2,
		"Remark": "sample string 3"
 */
export const cancelOrders = (data) => {
	return http.request({
		url: '/API/Orders/CancelOrders',
		method: 'POST',
		data
	})
}

/* 
	@desc 退款/退货申请
		{
	      "InfoId": 1,
	      "Remark": "sample string 2",
	      "ProductOrdersCouponInfoCode": "sample string 3",
	      "OrdersOnLineId": 4,
	      "OrdersOnLineType": 5
	    },
 */
export const refundOrders = (data) => {
	return http.request({
		url: '/API/Orders/RefundOrders',
		method: "POST",
		data
	})
}


/* 
	@desc 获取购物车列表
 */
export const getProductCarList = (data) => {
	return http.request({
		url: '/API/ProductCar/GetProductCarList',
		method: 'POST',
		data
	})
}

/* 
	@desc 添加购物车
 */
export const addProductCar = (data) => {
	return http.request({
		url: '/API/ProductCar/AddProductCar',
		method: "POST",
		data
	})
}

/* 
	@desc 删除购物车
 */
export const delProductCar = (data) => {
	return http.request({
		url: '/API/ProductCar/DelProductCar',
		method: "POST",
		data
	})
}
/*
	@desc 删除购物车
 */
export const modifyTheQuantity = (data) => {
	return http.request({
		url: '/API/ProductCar/UpdateProductCarNum',
		method: "POST",
		data
	})
}

/* 
	@desc 获取购物车商品数量
 */
export const getUserProductCarItemNum = (data) => {
	return http.request({
		url: '/API/ProductCar/GetUserProductCarItemNum',
		method: 'POST',
		data
	})
}


/* 
	@desc 获取用户收藏列表
 */
export const getProductCollectionList = (data) => {
	return http.request({
		url: '/API/Users/GetProductCollectionList',
		method: 'POST',
		data
	})
}
//收藏列表
export const getNewtCollectionList = (data) => {
	return http.request({
		url: '/API/Users/GetCollectionList',
		method: 'POST',
		data
	})
}

/* 
	@desc 发布评论
 */
export const addEvaluation = (data) => {
	return http.request({
		url: '/API/Users/AddEvaluation',
		method: 'POST',
		data
	})
}

/* 
	@desc 去支付（微信下单 - 再次发起支付时调用
 */
export const productOrdersPay = (data) => {
	return http.request({
		url: '/API/Orders/ProductOrdersPay',
		method: 'POST',
		data
	})
}
/*
	@desc 去支付（微信下单 - 再次发起支付时调用
 */
export const getOrderDetails = (data) => {
	return http.request({
		url: '/API/Orders/GetOrderDetail',
		method: 'POST',
		data
	})
}

/*
	@desc 获取商家相关的评论
 */
export const getBusinessEvaluations = (data) => {
	return http.request({
		url: '/API/Business/GetBusinessEvaluations',
		method: 'POST',
		data
	})
}
/*
	@desc 获取产品相关的评论
 */
export const getProductEvaluations = (data) => {
	return http.request({
		url: '/API/Product/GetProductEvaluations',
		method: 'POST',
		data
	})
}

/* 
	@desc 确认收货
 */
export const acceptOrders = (data) => {
	return http.request({
		url: '/API/Orders/AcceptOrders',
		method: 'POST',
		data
	})
}

/*
	@desc 获取物流信息
 */
export const getLogistics = (data) => {
	return http.request({
		url: '/API/Orders/GetProductLogistInfo',
		method: 'POST',
		data
	})
}
/*
	@desc 获取物流信息
 */
export const billing = (data) => {
	return http.request({
		url: '/API/UserInvoiceApply/CreateInvoiceApply',
		method: 'POST',
		data
	})
}/*
	@desc 获取物流信息
 */
export const checkBilling = (data) => {
	return http.request({
		url: '/API/UserInvoiceApply/CheckInvoiceApply',
		method: 'POST',
		data
	})
}/*
	@desc 获取物流信息
 */
export const QueryRefundFee = (data) => {
	return http.request({
		url: '/API/Orders/QueryRefundFee',
		method: 'POST',
		data
	})
}

// 获取票务区间与价格
export const getTicketCalendar = (data) => {
	console.log('getTicketCalendar', data)
	return http.request({
		url: '/GetTicketProdcutSceneTime',
		method: 'POST',
		data
	})
}

// 获取票务区间与价格
export const getTimeSharingByTicket = (data) => {
	console.log('getTicketCalendar', data)
	return http.request({
		url: '/API/Product/GetTicketProductSeasonInfo',
		method: 'POST',
		data
	})
}

// 获取核销列表
export const GetUserOrderListToBeVerified = (data) => {
	return http.request({
		url: '/API/Orders/GetUserOrderList_ToBeVerified_TrendsCode',
		method: 'POST',
		data
	})
}
export const GetUserOrderListToTrendsCode = (data) => {
	return http.request({
		url: '/API/Orders/GetUserCoupons_TrendsCode',
		method: 'POST',
		data
	})
}
// 核销数据
export const PostUserOrderListToBeVerified = (data) => {
	return http.request({
		url: '/API/Orders/PostUserOrderList_ToBeVerified',
		method: 'POST',
		data
	})
}
// 核销数据
export const PostUserVerifyCoupons = (data) => {
	return http.request({
		url: '/API/Orders/VerifyCoupons',
		method: 'POST',
		data
	})
}

export const queryPortInformation = () => {
	return http.request({
		url: '/API/Ship/GetShipPort',
		method: 'POST'
	})
}
export const checkFlightInformation = (data) => {
	return http.request({
		url: '/API/Ship/GetShipClass',
		method: 'POST',
		data
	})
}
export const isLanderTicket = (data) => {
	return http.request({
		url: '/API/Ship/IsLanderTicket',
		method: 'POST',
		data
	})
}
export const refundShipTicket = (data) => {
	return http.request({
		url: '/API/Orders/RefundShipTicket',
		method: 'POST',
		data
	})
}
export const refundShipTickets = (data) => {
	return http.request({
		url: '/API/Orders/RefundShipTickets',
		method: 'POST',
		data
	})
}

